# meta-name: EnemyAction
# meta-description: An action which can be performed by an enemy during its turn.
extends EnemyAction


func perform_action() -> void:
	if not enemy or not target:
		return
	
	var tween := create_tween().set_trans(Tween.TRANS_QUINT)
	var start := enemy.global_position
	var end := target.global_position + Vector2.RIGHT * 32
	
	SFXPlayer.play(sound)

	Events.enemy_action_completed.emit(enemy)


# If the enemy has dynamic intent text you can override the base behaviour here
# 注意：敌人意图应该显示其原始攻击力，而不是被玩家修改器影响后的数值
# 这样玩家可以清楚地看到敌人的真实威胁
func update_intent_text() -> void:
	# 显示敌人的原始攻击力
	intent.current_text = intent.base_text % 6  # 替换为实际的伤害值
